package com.springboot.example.monitor.dao.impl;

import com.springboot.example.monitor.dao.PolicyUserDao;
import com.springboot.example.monitor.mapper.PolicyUserMapper;
import com.springboot.example.monitor.domain.db.PolicyUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * PolicyUser
 * <p/>
 * User: guoyao
 * DateTime: 2016-02-23 16:23:51
 */
@Service("policyUserDao")
public class PolicyUserDaoImpl implements PolicyUserDao {

    @Resource
    private PolicyUserMapper policyUserMapper;

    /**
     * 根据主键查询PolicyUser对象
     *
     * @param policyId
     * @return PolicyUser对象
     */
    @Override
    public PolicyUser selectByPrimaryKey(Long policyId) {
        return policyUserMapper.selectByPrimaryKey(policyId);
    }

    /**
     * 根据查询条件查询符合条件的PolicyUser对象
     *
     * @param policyUser
     * @return 符合条件的PolicyUser对象List
     */
    @Override
    public List<PolicyUser> select(PolicyUser policyUser) {
        return policyUserMapper.select(policyUser);
    }

    /**
     * 根据主键删除PolicyUser对象
     *
     * @param policyId
     * @return 影响条件数
     */
    @Override
    public int deleteByPrimaryKey(Long policyId) {
        return policyUserMapper.deleteByPrimaryKey(policyId);
    }

    /**
     * 根据条件删除符合条件的PolicyUser对象
     *
     * @param policyUser
     * @return 影响条件数
     */
    @Override
    public int delete(PolicyUser policyUser) {
        return policyUserMapper.delete(policyUser);
    }

    /**
     * 插入PolicyUser对象
     *
     * @param policyUser
     * @return 影响条件数
     */
    @Override
    public int insert(PolicyUser policyUser) {
        return policyUserMapper.insert(policyUser);
    }

    /**
     * 更新PolicyUser对象
     *
     * @param policyUser
     * @return 影响条件数
     */
    @Override
    public int update(PolicyUser policyUser) {
        return policyUserMapper.update(policyUser);
    }
}
